#include "RBTree.h"
#include <vector>
using std::vector;

int main()
{
	const int N = 10000000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		//v.push_back(i);
		v.push_back(rand());
	}

	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	//int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
 	RBTree<int, int> t;
	for (auto e : a)
	{	
		t.insert(std::make_pair(e, e));
		//cout << "Insert:" << e << "->" << t.IsBalance() << endl;
	}
	//cout << t.IsBalance() << endl;
	t.preOrder();
	return 0;
}